<?php
namespace models;

class games
{

    public function getByUserID($teacher_id)
    {

        $r['data'] = db('games')->where('teacher_id=?', $teacher_id)->order('id Desc')->fetchAll();
        $r['data'] ? $r['code'] = 0 : $r['msg'] = '暂无游戏';
        return $r;
    }



}
